import request from '@/utils/request'
import type {
  TableDate,
  ChartPie,
  CompanyInfo,
  DataStructureGroup
} from './type'
enum API {
  CONFIG_TABLE = '/right/table',
  CONFIG_ROSE = '/left/chartPie',
  CONFIG_COMPANY = '/right/company',
  CONFIG_GROUP = '/safe/infoGroup'
}

/* 获取表格数据 */
function getTableData() {
  return request.get<any, TableDate>(API.CONFIG_TABLE)
}

/* 获取饼图数据 */
function getRose() {
  return request.get<any, ChartPie>(API.CONFIG_ROSE)
}

/* 获取安全承诺公司 */
function getCompany() {
  return request.get<any, CompanyInfo>(API.CONFIG_COMPANY)
}

/* 获取其他信息集合 */
function getInfoGroup() {
  return request.get<any, DataStructureGroup>(API.CONFIG_GROUP)
}
export const config = {
  getTableData,
  getRose,
  getCompany,
  getInfoGroup
}
